package com.zhouyx.userservice.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @title: Item
 * @Author: max.zhou1
 * @Date: 2024/9/19 11:07
 * @Version: 1.0
 **/
@Data
public class Item {
    private String name;
    private int size;
    private boolean carOwner;

    // standard getters and setters

    public static void main(String[] args) {
        List<Item> items = new ArrayList<>();

        Item item1 = new Item();
        item1.setName("1");
//        item1.setCarOwner(false);
        items.add(item1);

        Item item2 = new Item();
        item2.setName("2");
        item2.setCarOwner(true);
        items.add(item2);

        boolean carOwner = items.stream().anyMatch(Item::isCarOwner);
        System.out.println(carOwner);
    }
}
